package com.caixin.domain.user.agg;

import com.caixin.domain.common.BaseAggregate;
import com.caixin.domain.user.types.unique.UserId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;


/**
 * @Description
 * @Author caicx
 * @date 2021.09.17 20:05
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class User extends BaseAggregate<UserId> {

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空！")
    @Size(min=20,max=50,message = "用户名长度20~50字符！")
    private String userName;
    /**
     * 用户密码
     */
    @NotBlank(message = "用户密码不能为空！")
    @Size(min=20,max=50,message = "用户密码长度20~50字符！")
    private String userPassword;
    /**
     * 创建日期
     */
    @NotNull(message = "创建日期不能为空！")
    private LocalDateTime createDate;


}
